<template>
  <view class="item" @tap="handleJump">
    <text class="item-title">{{name}}</text>
    <image class="item-icon" :src="iconRight"></image>
  </view>
</template>

<script>
export default {
  props: {
    url: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: ''
    }
  },
  data(){
    return {
      icon: 'https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg',
      iconRight: '',
    }
  },
  methods: {
    handleJump(){
      let pageInfo = {
        url: `${this.url}`,
        animated: true
      };
      console.log('pageInfo:', JSON.stringify(pageInfo))
      Navigator.openPage(pageInfo, (result) => {
          console.log('Page result: ' + JSON.stringify(result));
      });
    }
  }
}
</script>

<style scoped>
  .item{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    height: 1rem;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
  }
  .item-title{
    flex: 1;
    color: blue;
    text-align: center;
  }
  .item-icon{
    width: .36rem;
    height: .36rem;
    resize: cover;
    margin-right: .2rem;
  }
</style>